package cn.edu.hhtc.stsystem.security.domain;

import java.io.Serializable;
import java.util.LinkedHashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

/**
 * 系统资源表.
 * 
 * @author linyueqin
 * 
 */
@Entity
@Table(name = "SYS_RESOURCES")
public class SysResources implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3131903014310106934L;

	@Id
	@Column(name = "ID")
	private Long id;

	@Column(name = "NAME")
	private String name;

	@Column(name = "RESOURCE_TYPE")
	private String resourceType;

	@Column(name = "ORDER_NUM")
	private Integer orderNum;

	@Column(name = "VALUE")
	private String value;

	@Column(name = "ENABLED")
	private Integer enabled;

	@Column(name = "IS_SYS")
	private Integer isSys;

	@ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.LAZY, mappedBy = "resources")
	private Set<SysAuthorities> authorities = new LinkedHashSet<SysAuthorities>();

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getResourceType() {
		return resourceType;
	}

	public void setResourceType(String resourceType) {
		this.resourceType = resourceType;
	}

	public Integer getOrderNum() {
		return orderNum;
	}

	public void setOrderNum(Integer orderNum) {
		this.orderNum = orderNum;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public Integer getEnabled() {
		return enabled;
	}

	public void setEnabled(Integer enabled) {
		this.enabled = enabled;
	}

	public Integer getIsSys() {
		return isSys;
	}

	public void setIsSys(Integer isSys) {
		this.isSys = isSys;
	}

	public Set<SysAuthorities> getAuthorities() {
		return authorities;
	}

	public void setAuthorities(Set<SysAuthorities> authorities) {
		this.authorities = authorities;
	}

}
